package com.kaichaohulian.baocms.entity;

import android.support.annotation.NonNull;

/**
 * Created by Angel on 2017/9/12.
 */

public class ShowCityBean implements Comparable<ShowCityBean> {

    public static final int TYPE_LETTER = 1;
    public static final int TYPE_CITY = 2;

    private int type;
    private char letter;
    private String cnName;
    private String cityId;

    public ShowCityBean(int type, char letter, String cnName, String cityId) {
        this.type = type;
        this.letter = letter;
        this.cnName = cnName;
        this.cityId = cityId;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public char getLetter() {
        return letter;
    }

    public void setLetter(char letter) {
        this.letter = letter;
    }

    public String getCnName() {
        return cnName;
    }

    public void setCnName(String cnName) {
        this.cnName = cnName;
    }

    public String getCityId() {
        return cityId;
    }

    public void setCityId(String cityId) {
        this.cityId = cityId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        ShowCityBean that = (ShowCityBean) o;

        return cityId != null ? cityId.equals(that.cityId) : that.cityId == null;
    }

    @Override
    public int hashCode() {
        return cityId != null ? cityId.hashCode() : 0;
    }

    @Override
    public String toString() {
        return "ShowCityBean{" +
                "letter=" + letter +
                ", cnName='" + cnName + '\'' +
                ", cityId=" + cityId +
                '}';
    }

    @Override
    public int compareTo(@NonNull ShowCityBean another) {
        return letter - another.letter;
    }
}
